package lc.util;

import java.io.File;
import java.net.URL;

import com.jme.util.resource.ResourceLocator;

public final class CoincidentTextureLocator implements ResourceLocator {
	public String basePath;
	public URL locateResource(String resourceName) {
		try {
			if (basePath != null) {
				String fileName = resourceName.substring(resourceName.lastIndexOf('/')+1);
				File f = new File(basePath + "/" + fileName);
				if (f.exists() && f.isFile()) {
					return f.toURL();
				}
			}
		}
		catch (Exception x) {
			return null;
		}
		return null;
	}
}
